load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("@kubevirt//tools/ginkgo:ginkgo.bzl", "ginkgo_test")

go_library(
    name = "go_default_library",
    srcs = [
        "generated_mock_manager.go",
        "live-migration-source.go",
        "live-migration-target.go",
        "manager.go",
    ],
    importpath = "kubevirt.io/kubevirt/pkg/virt-launcher/virtwrap",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/apimachinery/wait:go_default_library",
        "//pkg/cloud-init:go_default_library",
        "//pkg/config:go_default_library",
        "//pkg/container-disk:go_default_library",
        "//pkg/controller:go_default_library",
        "//pkg/downwardmetrics:go_default_library",
        "//pkg/emptydisk:go_default_library",
        "//pkg/ephemeral-disk:go_default_library",
        "//pkg/ephemeral-disk-utils:go_default_library",
        "//pkg/handler-launcher-com/cmd/v1:go_default_library",
        "//pkg/hooks:go_default_library",
        "//pkg/host-disk:go_default_library",
        "//pkg/hotplug-disk:go_default_library",
        "//pkg/ignition:go_default_library",
        "//pkg/liveupdate/memory:go_default_library",
        "//pkg/network/cache:go_default_library",
        "//pkg/network/deviceinfo:go_default_library",
        "//pkg/network/setup:go_default_library",
        "//pkg/network/vmispec:go_default_library",
        "//pkg/os/disk:go_default_library",
        "//pkg/pointer:go_default_library",
        "//pkg/safepath:go_default_library",
        "//pkg/storage/cbt:go_default_library",
        "//pkg/storage/types:go_default_library",
        "//pkg/tpm:go_default_library",
        "//pkg/unsafepath:go_default_library",
        "//pkg/util:go_default_library",
        "//pkg/util/hardware:go_default_library",
        "//pkg/util/migrations:go_default_library",
        "//pkg/util/net/ip:go_default_library",
        "//pkg/virt-controller/services:go_default_library",
        "//pkg/virt-handler/cmd-client:go_default_library",
        "//pkg/virt-handler/migration-proxy:go_default_library",
        "//pkg/virt-launcher/metadata:go_default_library",
        "//pkg/virt-launcher/virtwrap/access-credentials:go_default_library",
        "//pkg/virt-launcher/virtwrap/agent:go_default_library",
        "//pkg/virt-launcher/virtwrap/agent-poller:go_default_library",
        "//pkg/virt-launcher/virtwrap/api:go_default_library",
        "//pkg/virt-launcher/virtwrap/cli:go_default_library",
        "//pkg/virt-launcher/virtwrap/converter:go_default_library",
        "//pkg/virt-launcher/virtwrap/converter/arch:go_default_library",
        "//pkg/virt-launcher/virtwrap/converter/vcpu:go_default_library",
        "//pkg/virt-launcher/virtwrap/device/hostdevice:go_default_library",
        "//pkg/virt-launcher/virtwrap/device/hostdevice/dra:go_default_library",
        "//pkg/virt-launcher/virtwrap/device/hostdevice/generic:go_default_library",
        "//pkg/virt-launcher/virtwrap/device/hostdevice/gpu:go_default_library",
        "//pkg/virt-launcher/virtwrap/device/hostdevice/sriov:go_default_library",
        "//pkg/virt-launcher/virtwrap/efi:go_default_library",
        "//pkg/virt-launcher/virtwrap/errors:go_default_library",
        "//pkg/virt-launcher/virtwrap/libvirtxml:go_default_library",
        "//pkg/virt-launcher/virtwrap/network:go_default_library",
        "//pkg/virt-launcher/virtwrap/stats:go_default_library",
        "//pkg/virt-launcher/virtwrap/statsconv:go_default_library",
        "//pkg/virt-launcher/virtwrap/util:go_default_library",
        "//staging/src/kubevirt.io/api/core/v1:go_default_library",
        "//staging/src/kubevirt.io/client-go/log:go_default_library",
        "//tools/cache:go_default_library",
        "//vendor/go.uber.org/mock/gomock:go_default_library",
        "//vendor/k8s.io/api/core/v1:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/api/equality:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library",
        "//vendor/libvirt.org/go/libvirt:go_default_library",
        "//vendor/libvirt.org/go/libvirtxml:go_default_library",
    ],
)

go_test(
    name = "go_default_test",
    srcs = [
        "live-migration-source_test.go",
        "live-migration-target_test.go",
        "manager_test.go",
        "virtwrap_suite_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":go_default_library"],
    embedsrcs = ["testdata/migration_domain.xml"],
    race = "on",
    tags = ["cov"],
    deps = [
        "//pkg/cloud-init:go_default_library",
        "//pkg/ephemeral-disk-utils:go_default_library",
        "//pkg/ephemeral-disk/fake:go_default_library",
        "//pkg/handler-launcher-com/cmd/v1:go_default_library",
        "//pkg/host-disk:go_default_library",
        "//pkg/libvmi:go_default_library",
        "//pkg/libvmi/status:go_default_library",
        "//pkg/liveupdate/memory:go_default_library",
        "//pkg/pointer:go_default_library",
        "//pkg/storage/cbt:go_default_library",
        "//pkg/testutils:go_default_library",
        "//pkg/util/net/ip:go_default_library",
        "//pkg/virt-config:go_default_library",
        "//pkg/virt-handler/cmd-client:go_default_library",
        "//pkg/virt-launcher/metadata:go_default_library",
        "//pkg/virt-launcher/virtwrap/agent-poller:go_default_library",
        "//pkg/virt-launcher/virtwrap/api:go_default_library",
        "//pkg/virt-launcher/virtwrap/cli:go_default_library",
        "//pkg/virt-launcher/virtwrap/converter:go_default_library",
        "//pkg/virt-launcher/virtwrap/converter/arch:go_default_library",
        "//pkg/virt-launcher/virtwrap/converter/vcpu:go_default_library",
        "//pkg/virt-launcher/virtwrap/efi:go_default_library",
        "//pkg/virt-launcher/virtwrap/errors:go_default_library",
        "//pkg/virt-launcher/virtwrap/network:go_default_library",
        "//pkg/virt-launcher/virtwrap/stats:go_default_library",
        "//pkg/virt-launcher/virtwrap/testing:go_default_library",
        "//staging/src/kubevirt.io/api/core/v1:go_default_library",
        "//staging/src/kubevirt.io/client-go/api:go_default_library",
        "//staging/src/kubevirt.io/client-go/testutils:go_default_library",
        "//vendor/github.com/onsi/ginkgo/v2:go_default_library",
        "//vendor/github.com/onsi/gomega:go_default_library",
        "//vendor/github.com/onsi/gomega/gstruct:go_default_library",
        "//vendor/go.uber.org/mock/gomock:go_default_library",
        "//vendor/k8s.io/api/core/v1:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library",
        "//vendor/libvirt.org/go/libvirt:go_default_library",
        "//vendor/libvirt.org/go/libvirtxml:go_default_library",
    ],
)

ginkgo_test(
    name = "go_parallel_test",
    ginkgo_args = ["-p"],
    go_test = ":go_default_test",
    tags = ["nocov"],
)
